<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简单鼠标手势 - 设置</title>
    <style>
        /* 整体页面样式 */
        body {
            font-family: 'Arial', sans-serif;
            background: linear-gradient(to bottom right, #f4f4f9, #e6e6ef);
            padding: 20px;
            color: #333;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            font-size: 15px; /* 设置全局字体大小为 15px */
        }

        /* 容器样式 */
        .container {
            max-width: 90%; /* 增加容器宽度 */
            width: 750px; /* 设定一个固定的宽度以适应大多数屏幕 */
            background: white;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
        }

        /* 提示文字样式 */
        .tip {
            margin: 20px 0;
            padding: 10px;
            background-color: #f9f9f9;
            border-left: 4px solid #007bff;
            color: #333;
        }

        /* 标题样式 */
        h2 {
            color: #005bb5;
            border-bottom: 3px solid #e0e0e0;
            padding-bottom: 10px;
            margin-bottom: 30px;
            text-align: center;
        }

        /* 标签样式 */
        label {
            display: block;
            margin-bottom: 12px;
            font-weight: bold;
        }

        /* 颜色和范围输入框样式 */
        input[type="color"],
        input[type="range"] {
            width: 100%;
            margin-bottom: 25px;
        }

         /* 自定义复选框样式 */
         input[type="checkbox"] {
            appearance: none; /* 移除默认样式 */
            -webkit-appearance: none;
            -moz-appearance: none;
            width: 18px;
            height: 18px;
            border: 2px solid #ccc;
            border-radius: 4px;
            outline: none;
            cursor: pointer;
            position: relative;
            vertical-align: middle;
            margin-left: 5px;
        }

        input[type="checkbox"]:checked {
            background-color: #007bff; /* 选中时的背景颜色 */
            border-color: #007bff; /* 选中时的边框颜色 */
        }

        input[type="checkbox"]:checked::after {
            content: '\2713'; /* 选中时显示的对勾符号 */
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-size: 14px;
        }

        /* 按钮样式 */
        button {
            background-color: #007bff;
            border: none;
            color: white;
            padding: 12px 20px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 1em; /* 使用相对单位确保按钮文本大小与全局一致 */
            margin: 20px 0;
            cursor: pointer;
            border-radius: 8px;
            transition: background-color 0.3s ease;
        }

        button:hover {
            background-color: #0056b3;
        }

        /* 手势说明容器样式 */
        .gesture-instructions {
            margin-top: 30px;
        }

        /* 手势说明列表样式 */
        .gesture-instructions ul {
            list-style-type: none;
            padding-left: 0;
        }

        .gesture-instructions li {
            background: #f9f9f9;
            margin-bottom: 15px;
            padding: 15px;
            border-radius: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            word-break: break-all; /* 支持长文本换行 */
        }

        .gesture-instructions li:hover {
            background-color: #e9e9e9;
        }

        /* 添加新的样式 */
        .gesture-customization {
            margin-top: 20px;
        }

        .gesture-buttons {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }

        .add-gesture-btn, .reset-gesture-btn {
            flex: 1;
        }

        .reset-gesture-btn {
            background-color: #007bff;
        }

        .reset-gesture-btn:hover {
            background-color: #0056b3;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
        }

        .modal-content {
            background-color: white;
            margin: 15% auto;
            padding: 20px;
            border-radius: 8px;
            width: 80%;
            max-width: 500px;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
        }

        .form-group select, .form-group input {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }

        select[multiple] {
            height: 100px;
        }

        .button-group {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        .gesture-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            margin-bottom: 10px;
            background-color: #f5f5f5;
            border-radius: 4px;
        }

        .gesture-item .gesture-actions {
            display: flex;
            gap: 10px;
        }

        .gesture-item button {
            padding: 5px 10px;
            margin: 0;
        }

        .delete-btn {
            background-color: #dc3545;
        }

        .delete-btn:hover {
            background-color: #c82333;
        }
    </style>
    <script src="libs/translate.min.js"></script>
</head>

<body>
    <div class="container">
        <!-- 提示文字 -->
        <div class="tip">
            手势打开计算器/翻译后再次手势可以关闭。按方向键上下回显历史输入。<br />
            翻译支持输入中文翻译为英文，输入英文翻译为中文。
            <br />
            计算器输入scale = n， 设置保留 n 位小数 (0 <= n < 10)，默认为保留 3 位小数。
        </div>

        <!-- 颜色和画笔设置 -->
        <div>
            <label for="color-picker">轨迹颜色：</label>
            <input type="color" id="color-picker" value="#006dce">
        </div>
        <div>
            <label for="brush-width">画笔宽度：</label>
            <input type="range" id="brush-width" min="2" max="6" value="3">
        </div>
        <div>
            <label for="show-trace-text">显示轨迹文字提示：
                <input type="checkbox" id="show-trace-text">
            </label>
        </div>
        
        <button id="save-button">保存设置</button>

        <hr>
        <label>
          <input type="checkbox" id="enableDragSearch">
          启用拖拽搜索
        </label>
        <br>
        <label>
          搜索引擎：
          <input type="text" id="searchEngine" value="https://www.bing.com/search?q=%s" style="width: 300px;">
        </label>

        <div class="gesture-instructions">
            <h2>手势操作</h2>
            <div class="gesture-customization">
                <div class="gesture-buttons">
                    <button id="reset-gesture" class="reset-gesture-btn">重置为默认配置</button>
                </div>
                <div id="gesture-list">
                    <!-- 手势列表将通过JavaScript动态填充 -->
                </div>
            </div>
        </div>
    </div>
    <script src="options.js"></script>
    <script src="content.js"></script>
</body>

</html>